package com.maybach.workflow.core.config.parser;


import com.maybach.workflow.common.api.node.BaseNode;
import com.maybach.workflow.common.api.node.JoinNode;
import org.w3c.dom.Element;

/**
 * Created by well on 15/6/11.
 */
public class JoinParser implements Parser{

    public String nodeName = NodeParser.NODE_NAME_JOIN;


    @Override
    public BaseNode parse(Element element) {
        if(element == null){
            return null;
        }
        if(!nodeName.equalsIgnoreCase(element.getNodeName())){
            return null;
        }
        JoinNode joinnode = new JoinNode();
        joinnode.setName(element.getAttribute(NodeParser.ATTR_NAME));
        joinnode.setTo(element.getAttribute(NodeParser.ATTR_TO));
        return joinnode;
    }
}
